<template>
  <div>
    <div id="myChart" :style="{width: '500px', height: '500px'}"></div>
  </div>
</template>

<script>
import echarts from "echarts";
export default {
  name: "hand",
  data(){
    return{}
  },
  methods:{
      drawPie(id){
                this.charts = echarts.init(document.getElementById(id));
                this.charts.setOption({
                  xAxis: {
                      type: 'category',
                      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                  },
                  yAxis: {
                      type: 'value'
                  },
                  series: [{
                      data: [150, 230, 224, 218, 135, 147, 260],
                      type: 'line'
                  }]
                })
      }
  },
  //调用
  mounted() {
    this.$nextTick(function() {
                this.drawPie('myChart')
            })
  }
};
</script>

